<?php
/**
 * alltosun.com  IndexController.Class.php
 * ============================================================================
 * 版权所有 (C) 2015 齐齐哈尔大学计算机与控制工程学院，并保留所有权利。
 * ============================================================================
 * $Author: 范志俊 (fanfzj@163.com) $
 * $Date: 2015-10-22 上午12:24:54 $
 */
namespace Admin\Controller;
use Think\Controller;
class IndexController extends AuthController {
    public function index(){
        $admin=get_config_value('admin_name');
        if((session('admin_username')==$admin)&&(strlen(session('admin_id'))!=0))
        {
            $new_student=M("Student")->order('create_time desc')->limit(10)->select();
            $this->assign('new_student',$new_student);
            $this->display(':index');
        }
        else
        {
            $site_img=get_config_value('site_img');
            if(empty($site_img))
            {
                $site_img=__ROOT__.'/Public/Images/background.jpg';
            }
            $site_name=get_config_value('site_name');
            $this->assign('site_img',$site_img);
            $this->assign('site_name',$site_name);
            $this->display(':login');
        }
    }
}